// Colyseus + Express
import { LobbyRoom, Server } from "colyseus";
import { createServer } from "http";
import express from "express";
import { GameRoom } from "./Room/GameRoom";
import { monitor } from "@colyseus/monitor";
const port = Number(process.env.port) || 3000;

const app = express();
app.use(express.json());
app.use("/colyseus", monitor());

const gameServer = new Server({
  server: createServer(app),
});
gameServer.define('my_room',GameRoom)
gameServer.define('lobby',LobbyRoom)
gameServer.listen(port);
console.log(`server is listening on http://localhost:${port}`);
